package com.zone.sdk.module.appstore.entity;

import com.zone.sdk.module.appstore.base.StoreUtils;

import java.io.Serializable;

public class ResourceItem implements Serializable {
    private static final long serialVersionUID = -1633486674928282017L;
    /**
     * 资源ID（ICON、PREVIEW）
     *
     * @apiNote app/product/page/v1
     */
    private String resourceId;
    /**
     * 资源类型（1图片2视频）
     *
     * @apiNote app/product/page/v1
     */
    private String resourceType;
    /**
     * 资源地址
     *
     * @apiNote app/product/page/v1
     */
    private String resourceUrl;
    /**
     * 背景色
     *
     * @apiNote app/product/page/v1
     */
    private String resourceColor;


    public String getResourceId() {
        return resourceId;
    }

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    public String getResourceType() {
        return resourceType;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }

    public String getResourceUrl() {
        return resourceUrl;
    }

    public void setResourceUrl(String resourceUrl) {
        this.resourceUrl = resourceUrl;
    }

    public String getResourceColor() {
        return resourceColor;
    }

    public void setResourceColor(String resourceColor) {
        this.resourceColor = resourceColor;
    }

    public boolean isVideo() {
        return StoreUtils.RESOURCE_TYPE_VIDEO.equals(resourceType);
    }

    public boolean isPicture() {
        return StoreUtils.RESOURCE_ID_PREVIEW.equals(resourceId);
    }

    public void copy(ResourceItem source) {
        this.resourceId = source.resourceId;
        this.resourceType = source.resourceType;
        this.resourceUrl = source.resourceUrl;
        this.resourceColor = source.resourceColor;
    }
}
